﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="Permission.aspx.cs" Inherits="Admin_Permission" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style8
        {
            height: 34px;
        }
        .style9
        {
            text-align: center;
        }
        .style10
        {
            width: 77px;
        }
        .style11
        {
            text-align: right;
            width: 447px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style7">
        <tr>
            <td colspan="3" style="text-align: center; font-weight: 700; color: #0066FF">
                <asp:Label ID="Label1" runat="server" Text="Permission"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="3" style="text-align: center">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="roleId,moduleId" 
                    DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
                    <RowStyle BackColor="#EFF3FB" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="roleId" HeaderText="roleId" ReadOnly="True" 
                            SortExpression="roleId" />
                        <asp:BoundField DataField="moduleId" HeaderText="moduleId" ReadOnly="True" 
                            SortExpression="moduleId" />
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    DeleteCommand="DELETE FROM [tblPermisson] WHERE [roleId] = @roleId AND [moduleId] = @moduleId" 
                    InsertCommand="INSERT INTO [tblPermisson] ([roleId], [moduleId]) VALUES (@roleId, @moduleId)" 
                    SelectCommand="SELECT * FROM [tblPermisson]">
                    <DeleteParameters>
                        <asp:Parameter Name="roleId" Type="Int32" />
                        <asp:Parameter Name="moduleId" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="roleId" Type="Int32" />
                        <asp:Parameter Name="moduleId" Type="Int32" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style8" colspan="3" style="text-align: center">
                <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="Add" />
&nbsp;</td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="3" style="font-weight: 700; text-align: center; color: #0066FF">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style9" colspan="3">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

